home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / Extras / DOPbt41 / 4 / rexx / conv.lzx->lha.rexx < prev    next >
OS/2 REXX Batch file  |  1995-04-18  |  1KB  |  60 lines

  1. /* $VER: 2.00 convert lzx to lha
  2.  
  3.   Create a button named LZX->LHA saying
  4.  
  5.   AmigaDOS    rx dopus:modules/rexx/conv.lzx->lha.rexx {f}
  6.  
  7.   FLAGS:
  8.   Do all files
  9.   No filename quote
  10.   Output window
  11.   Rescan source
  12.   
  13.   script will delete the extracted files and
  14.   delete the original file (.lha that is)
  15.  
  16.  
  17.   OR use from a shell
  18. */
  19.  
  20. ARG file
  21.  
  22. if ~show(l,"rexxsupport.library") then
  23. call addlib("rexxsupport.library",0,-30,0)
  24.  
  25. if file = '' then signal usage
  26. if file = '?' then signal usage
  27.  
  28. test = right(file,3)
  29. if test ~= 'LZX' then signal NOPE
  30. else say 'LZX to LHA by Niels <ABC>...working on -> 'file
  31.  
  32. NewFile = Left(File,Length(file)-3)'lha'
  33. makedir('sys:repack')
  34.  
  35. Address COMMAND 'c:assign repack: sys:repack'
  36. Address COMMAND 'delete repack:#? all force >nil:'
  37. Address COMMAND 'c:LZX -a -M X -F' file ' #? REPACK:'
  38. Address COMMAND 'lha -aerlb128MY -F a ' newFile ' REPACK:#?'
  39. Address COMMAND 'delete' file '>nil:'
  40. Address COMMAND 'c:assign repack: remove'
  41. Address COMMAND 'c:delete sys:repack all >nil:'
  42.  
  43. EXIT
  44.  
  45. USAGE:
  46.  
  47. say "USAGE: rx conv.lha->lzx [file].lha"
  48. say 
  49. say
  50. say "Will convert a single LHA-archive to LZX."
  51. say "AND delete the original LHA file..."
  52. say "(p) niels >ABC<"
  53. EXIT
  54.  
  55. NOPE:
  56. say 'I need a lzx file to work on, so'
  57. say file 
  58. say 'will not work. Sorry !'
  59. say
  60. EXIT